package cn.autumnorange.app.common.rpc;

import org.springframework.web.context.request.RequestContextHolder;
import org.springframework.web.context.request.ServletRequestAttributes;

import javax.servlet.http.HttpServletRequest;

public class RPCWrapper {
  public static <HSR extends HttpServletRequest> HSR getHttpServletRequestRPCWrapper() {
    ServletRequestAttributes attributes =
        (ServletRequestAttributes) RequestContextHolder.getRequestAttributes();
    return (HSR) attributes.getRequest();
  }
}
